﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Explore
{
    public class Explore
    {
        public static bool ExistsChildNode(System.Windows.Forms.TreeNode node)
        {
            DirectoryInfo dirlistview = new DirectoryInfo(node.Name);
            DirectoryInfo[] files = dirlistview.GetDirectories();
            foreach (DirectoryInfo file in files)
            {
                if ((file.Attributes & FileAttributes.Hidden) == 0 && (file.Attributes & FileAttributes.Temporary) == 0)
                    return true;
            }
            return false;
        }
        public static string FullPath(System.Windows.Forms.TreeNode node)
        {
            string path = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            if (node.FullPath.Contains("MyComputer\\")) return node.FullPath.Substring(11);
            else return path.Substring(0, path.IndexOf("Documents")) + node.FullPath;
        }

    }

}
